<?php
require_once (dirname(__FILE__)."/../config/config.php");
$content=getvpnlist();
outPutXml($content);
function getvpnlist(){
	$sql = "select * from zy_vpnlist";
	$result = mysql_query($sql);
	$content = "";
	while ($rs = mysql_fetch_array($result)) {
		$content .= "<result>\n";
		$content .= "<id>".$rs['id']."</id>\n";
		$content .= "<comment>".$rs['comment']."</comment>\n";
		$content .= "<type>".$rs['type']."</type>\n";
		$content .= "<server>".$rs['server']."</server>\n";
		$content .= "<port>".$rs['port']."</port>\n";
		$content .= "<protocol>".$rs['protocol']."</protocol>\n";
		$content .= "<interface>".$rs['interface']."</interface>\n";
		$content .= "<ca>".$rs['ca']."</ca>\n";
		$content .= "</result>\n";
	}
	return $content;
}
function outPutXml($content) {
	header("Content-type:text/xml");
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n";
	echo "<netcuberesult>\n";
	echo $content;
	echo "</netcuberesult>";
	die();
}